Repository navigation
rpc: vendor sui.rpc.v2beta checkpoint parts protos - #356
Draft
nickvikeras wants to merge 3 commits into
Draft
nickvikeras wants to merge 3 commits into
nickvikeras wants to merge 3 commits into
Conversation
Vendor the unmerged protos from MystenLabs/sui-apis#67: the unstable sui.rpc.v2beta package (CheckpointPart, CheckpointContentsPart, LedgerService.GetCheckpointParts/ListCheckpointParts and SubscriptionService.SubscribeCheckpointParts) and ErrorReason.CHECKPOINT_TOO_LARGE. The vendored v2 signature protos also pick up the reserved zklogin_v2 tags already on sui-apis main. Expose the generated v2beta module and Client::beta_ledger_client / Client::beta_subscription_client behind the `unstable` feature, like v2alpha. Ledger streams treat RESOURCE_EXHAUSTED with CHECKPOINT_TOO_LARGE as terminal instead of retrying it forever.
Re-vendor MystenLabs/sui-apis#67 at 9da63b2, which generalizes ErrorReason.CHECKPOINT_TOO_LARGE (11) to RESPONSE_TOO_LARGE for any single-message RPC whose rendered response exceeds the server's message limit, with `checkpoint` and `transaction` metadata replacing `sequenceNumber`. Ledger streams treat RESPONSE_TOO_LARGE as terminal.
Re-vendor MystenLabs/sui-apis#67 at b39732d, which clarifies in the CheckpointPart comment that parts pack consecutive complete transactions. Comment-only; no wire changes.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Vendors the protos from MystenLabs/sui-apis#67 so SDK users can call the streaming checkpoint parts API. That API reads a checkpoint as a stream of bounded-size
CheckpointParts, so it works for checkpoints larger than the server's response message limit. The PR adds:sui.rpc.v2betapackage:CheckpointPart,CheckpointContentsPart,LedgerService.GetCheckpointParts/ListCheckpointParts, andSubscriptionService.SubscribeCheckpointParts;sui.rpc.v2.ErrorReason.RESPONSE_TOO_LARGE, which single-message RPCs (the checkpoint RPCsGetCheckpoint,ListCheckpointsandSubscribeCheckpoints, and transaction and batch RPCs) return withRESOURCE_EXHAUSTEDwhen one rendered response exceeds the server's message size limit. Its metadata ismaxMessageBytes(always present), with optionalcheckpointandtransaction.These are MystenLabs/sui-apis#67's unmerged protos. Re-vendor from
sui-apismain(make -C crates/sui-rpc update-protos) and regenerate once MystenLabs/sui-apis#67 merges, before this PR merges. The vendoredv2/signature*.protofiles also pick up thereservedzklogin_v2tags from MystenLabs/sui-apis#66, which is already onmain. They change only the descriptor bytes.Feature gating:
proto::sui::rpc::v2betaand the newClient::beta_ledger_client/Client::beta_subscription_clientaccessors are behind theunstablefeature, likev2alphaandClient::proof_client. Theunstablefeature covers APIs outside the crate's semver guarantees, andv2betais allowed to break before it graduates intov2.ErrorReason::ResponseTooLargeis in stablev2, so it is not gated.Retry behavior: ledger streams retry every
RESOURCE_EXHAUSTED, but an item's size never changes, soRESPONSE_TOO_LARGEfails the same way on every attempt.stream_*(LedgerStreamConfigdefaultsmax_consecutive_retriestoNone) would retry it forever, andlist_*would use up its retries before failing. Ledger streams now treat it as terminal and return it to the caller.Test plan
client::ledger_streams::retry:response_too_large_is_terminal_in_both_phasesandresource_exhausted_without_response_too_large_is_transient.proto::sui::rpc::v2beta::descriptor::tests::file_descriptor_set_is_validdecodes the new package's descriptor set.cargo run -p proto-buildleaves the generated files unchanged.